/**
 * @description 自动import导入所有 api 模块
 */

 const files = import.meta.glob('./model/**/*.js', { eager: true });
 const modules = {};
 
 for (const path in files) {
   const paths = path.replace(/^\.\/model\/|\.js$/g, '').split('/');
   const module = files[path].default;
 
   let parent = modules;
   for (let i = 0; i < paths.length - 1; i++) {
     const name = paths[i];
     parent[name] = parent[name] || {};
     parent = parent[name];
   }
 
   const name = paths[paths.length - 1];
   parent[name] = module;
 }
 
 export default modules;